<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content") != null ? request.getParameter("content") : "";
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
<link rel="stylesheet"
	href="<%=basePath%>common/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
<script charset="utf-8"
	src="<%=basePath%>common/plugins/code/prettify.js"></script>
	<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
	<link rel="stylesheet" href="<%=basePath%>common/plugins/code/prettify.css" />
    <link href="<%=basePath%>common/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
      <link href="<%=basePath%>common/ad/fonts/iconfont.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="<%=basePath%>common/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="<%=basePath%>common/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath%>common/dist/css/skins/skin-blue.min.css" rel="stylesheet" type="text/css" />
     <link href="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
       <link href="<%=basePath%>common/plugins/datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
     <!-- jQuery 2.1.3 -->
    <script src="<%=basePath%>common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
         <script src="<%=basePath%>common/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js" type="text/javascript"></script>
        <script src="<%=basePath%>common/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <!-- FastClick -->
    <script src='<%=basePath%>common/plugins/fastclick/fastclick.min.js'></script>
	<!-- AdminLTE App -->
    <script src="<%=basePath%>common/dist/js/app.min.js" type="text/javascript"></script>
	<!-- AdminLTE for demo purposes -->
    <script src="<%=basePath%>common/dist/js/demo.js" type="text/javascript"></script>
      <!-- Bootstrap 3.3.2 JS -->
    <script src="<%=basePath%>common/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>    
    <!-- jvectormap -->
    <script src="<%=basePath%>common/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js" type="text/javascript"></script>
    <script src="<%=basePath%>common/plugins/jvectormap/jquery-jvectormap-world-mill-en.js" type="text/javascript"></script>
    <!-- datepicker -->
    <script src="<%=basePath%>common/plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="<%=basePath%>common/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js" type="text/javascript"></script>
    <script src="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
	<script src="<%=basePath%>common/uploadui/jquery.fileupload.js"></script>
	<script src="<%=basePath%>common/plugins/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script src="<%=basePath%>common/plugins/datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
	<script type="text/javascript" src="<%=basePath%>common/bootstrap/js/bootstrap.min.js"></script>
	
	<link rel="stylesheet" href="kindeditor/themes/default/default.css" />
		<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />
		<script charset="utf-8" src="kindeditor/kindeditor.js"></script>
		<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
		<script charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>
		<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : 'kindeditor/plugins/code/prettify.css',
				uploadJson : '../kindeditor/jsp/upload_json.jsp',
				fileManagerJson : '../kindeditor/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
		
		
		function check() {
			var title = document.getElementById('title').value;
			var content = document.getElementById('content').value;
			if (title) {
			
		} else {
			alert('需输入标题');
			document.getElementById("title").focus; 
			return false;
		//	example.number.focus();
		}
		if (content) {
			
		} else {
			alert('需输入要求');
			document.getElementById("content").focus; 
			return false;
		//	example.number.focus();
		}
		}
	</script>
<!-- Main content -->

<section class="content" id="refundcontent">
<div class="row">
	<div class="col-md-12">

		<div class="box box-danger">
			<div class="box-header">

				<section class="content-header">
				<h1>
					<ol class="breadcrumb">
						<li>
							<a href="<%=basePath%>showactive.do"><i
								class="fa fa-th-list fa-lg"></i>列表</a>
						</li>
						<li>
							发布活动
						</li>
					</ol>
				</h1>
				</section>
			</div>
			<div class="box-body">
				<!-- phone mask -->
				<div class="form-group">

					<div class="bg-info" style="padding: 10px;">
						<p>
							<form name="example" method="post" action="../addactive.do"
								accept-charset="UTF-8" onsubmit="document.charset='utf-8';return check()">
								标题：
								<input style="margin-right: 80px;" type="text" name="title"
									value="" id="title"/>
								<input type="hidden" name="time" value="">
								<br>
								<label>
									内容:
								</label>
								<textarea name="content" cols="100" rows="8" id="content"
							style="width: 100%; height: 200px; visibility: hidden;">
						<%=htmlspecialchars(htmlData)%></textarea>
								<br />
								<input type="submit" name="button" value="提交内容" />
							</form>
						</p>
					</div>
					
				</div>
			</div>
		</div>
	</div>
</div>
</section>
<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>